<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <!-- 引入react核心库 -->
  <script src="./node_modules/react/umd/react.development.js"></script>
  <!-- 引入react-dom 用于react支持react操作dom -->
  <script src="./node_modules/react-dom/umd/react-dom.development.js"></script>
</head>
<body>
  <div id="root"></div>
</body>
<script>
  // 创建react元素
  let title = React.createElement('h1',null,'你好')
  // 版本17
  // ReactDOM.render(title,document.getElementById('rootR'))
  // 版本18
  // 渲染到页面
  let root = ReactDOM.createRoot(document.getElementById('root'))
  root.render(title)
</script>
</html>